package com.clf.common.util.enums;


/**
 * Description: 手机端接口状态Status枚举类
 * 
 * @Date Create on 2015年10月26日
 * @author <a href="mailto:dingxin@zuozh.com">dpslife</a>
 * @since version1.0 Copyright 2015 ZZJR All Rights Reserved.
 */
public enum AppStatusEnum {
	
	SUCCESS(0, "成功"), PARAM_ERROR(1, "请求参数错误"), EXCEPTION_ERROR(2, "当前网络不稳定，请稍后重试"), NOT_EXPECT_DATA(3, "当前网络不稳定，请稍后重试"), INVALID_TOKEN(
			4, "当前网络不稳定，请稍后重试"), OTHER(5, "当前网络不稳定，请稍后重试"), SESSION_INVALID(6, "会话超时"), //
	DECRYPT_ERROR(7, "啊哦，系统开小差了");
	
	AppStatusEnum(Integer code, String value) {
		this.code = code;
		this.value = value;
	}
	
	public static AppStatusEnum getByValue(Integer code) {
		if (null != code) {
			for (AppStatusEnum type : values()) {
				if (type.getCode().equals(code)) {
					return type;
				}
			}
		}
		return null;
	}
	
	private Integer code;
	
	private String value;
	
	public Integer getCode() {
		return code;
	}
	
	public void setCode(Integer code) {
		this.code = code;
	}
	
	public String getValue() {
		return value;
	}
	
	public void setValue(String value) {
		this.value = value;
	}
}
